package net.ojbk.saishi.util;

import org.apache.commons.lang3.ArrayUtils;

public class StringTool {
	public static String formatFileName(String format, String[] basicInfoName, String[] basicInfo, String[] extraInfoName, String[] extraInfo) {
		String[] info = (String[]) ArrayUtils.addAll(basicInfo, extraInfo);
		String[] infoName = (String[]) ArrayUtils.addAll(basicInfoName, extraInfoName);
		String formatName = format;
		for (int i=0; i<infoName.length; i++) {
			System.out.println("[" + infoName[i] + "]" + "  ---   " + info[i]);
			formatName = formatName.replaceAll("\\[" + infoName[i] + "\\]", info[i]);
			System.out.println(formatName);
			
		}
		return formatName;
	}
}